﻿@using Scorpicore.MVC.Models;
@using Microsoft.AspNet.Identity;
@model Scorpicore.Models.ApplicationUser
@{
    ViewBag.Title = "Управление на акаунта";
}

<hgroup>
    <h3 class="legend-title">@ViewBag.Title</h3>
</hgroup>
@{
    var username = User.Identity.GetUserName();
    Scorpicore.Data.DataContext db = new Scorpicore.Data.DataContext();
    var model = db.Users.FirstOrDefault(u => u.UserName == username);
}
@if (model.AvatarUrl.Contains("default.jpg"))
{
    <img class="avater-image" src="../Avatars/default.jpg" style="width:30px;height:30px;" />
}
else
{
    <img class="avater-image" src="../Avatars/@User.Identity.GetUserName()/@(User.Identity.GetUserName()).png" style="width:100px;height:100px;" />
}
<div class="row-fluid">
    <div class="span6">
        <p class="text-success">@ViewBag.StatusMessage</p>
        @if (ViewBag.HasLocalPassword)
        {
            @Html.Partial("_ChangePasswordPartial")
        }
        else
        {
            @Html.Partial("_SetPasswordPartial")
        }

    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
